<template>
    <div id="ContentWarp">
        <div class="ClientTitle" v-show="BeginTeaching">
            {{configJIAOCAI.JIAOCAI}}<span>></span>{{configJIAOCAI.ZHANGJIE}}<span>></span>{{configJIAOCAI.KESHI}}
        </div>
        <router-view></router-view>
    </div>
</template>

<script>
    import publicFUN from './public'
    import Vue from 'vue'
    //数据管理模块  mapGetters == data  mapActions == methods
    import {mapGetters, mapActions} from 'vuex'
    import store from './store/'
    import axios from 'axios'
    export default {
        name: "",
        mounted() {
//            var loading = layer.load();
//
//
//
//            this.$http.post('api/userinfo/login', {//用户登录
//
//                username: store.state.mutations.loginName,
//                password: store.state.mutations.loginPassWord
//
//            }).then(function (res) {
//
//
//                UserLogin(store.state.mutations.loginName)
//
//                store.state.mutations.getToken = res.data.data.sk//获取并保存SK
//
//
//                //获取webConfig
//                axios({
//                    method: "GET",
//                    url: 'api/Webconfig/GetWebConfigValue' + '?sk=' + store.state.mutations.getToken
//                }).then(function (res) {
//                    console.log(res.data)
//                })
////                $.get('http://192.168.1.101:9100/api/Webconfig/GetWebConfigValue' + '?sk=' + store.state.mutations.getToken,{key:'serverIP,'},function (res) {
////                    console.log(res)
////                })
//
//
//                document.cookie = 'getToken = ' + res.data.data.sk + ''//SK保存在cookie中
//
//                if (res.data.message === '登陆成功！') {
//
//                    layer.msg('登陆成功', {icon: 1})
//
//                    setTimeout(function () {
//
//                        layer.close(loading);
//
//                        //登陆成功后获取用户信息
//                        Vue.prototype.$http.get(('api/userinfo/current?sk=' + store.state.mutations.getToken)).then(function (res) {
//                            store.state.mutations.USERINFO = res.data.data
//                        })
//                        //登陆成功后获取班级信息
//                        Vue.prototype.$http.get(('api/classinfo/myclass?sk=' + store.state.mutations.getToken)).then(function (res) {
//                            store.state.mutations.myClass = res.data.data
//                        })
//                        //登陆成功后获取当前老师教材
//                        Vue.prototype.$http.get(('api/teachingmaterial/myine?sk=' + store.state.mutations.getToken)).then(function (res) {
//                            store.state.mutations.teachingmaterial = res.data.data
//                            setTimeout(function () {
//                                document.querySelector('.TextBookList ul').getElementsByTagName('li')[0].setAttribute('class', 'confirmTextBook');
//                                //登陆后默认选中第一个教材
//                                store.state.mutations.configJIAOCAI.JIAOCAI = document.querySelector('.TextBookList ul').getElementsByTagName('li')[0].innerHTML;
//                                //默认选中第一个教材之后设置当前教材ID便于直接选择章节
//                                store.state.mutations.confirmTextBookID = document.querySelector('.TextBookList ul').getElementsByTagName('li')[0].getAttribute('data-id')
//                            }, 100)
//                        })
//
//                        setInterval(function () {
//                            //每8分钟更新一次sk
//                            Vue.prototype.$http.get(('api/auth/update?sk=' + store.state.mutations.getToken)).then(function (res) {
//                                document.cookie = 'getToken = ' + res.data.data + ''
//                                store.state.mutations.getToken = publicFUN.getCookie('getToken')
//                            })
//                        }, 48000)
//
//                        //                        router.push('/home/XB')
//                    }, 100)
//                } else {
//                    layer.msg('用户名或密码错误', {icon: 2})
//                }
//            })
        },
        computed: mapGetters([
            'configJIAOCAI',
            'BeginTeaching'
        ]),
        data() {
            return {}
        },
        methods() {

        }
    }
</script>

<style lang="scss" rel="stylesheet/scss" scoped>
    #ContentWarp {
        height: 100%;
        overflow: hidden;
        .ClientTitle {
            height: 70px;
            background: #fafafa;
            box-shadow: 0 2px 4px rgba(0, 0, 0, .4);
            text-shadow: 2px 2px 0 #aaa;
            font-size: 24px;
            font-weight: bold;
            color: #333;
            line-height: 70px;
            padding-left: 20px;
            span {
                padding: 0 5px;
            }
        }
        .btnTools{
            position: fixed;
            left:0;
            top: 0;
        }
    }
</style>